<template>
	<view>
		<div class="fs14 self_introduce lh22" :style="{height:seemore?introHeight : '' }">
			<div class="introduce pb20" :style="{'padding-top': audioArr.src ? '0' : '40rpx'}">
				<text style="color: black;">所有评价</text>
			</div>
			<div class="assessinfo" v-for="(assess,index) in assess" :key="index">
				<image :src="assess.userLogo"></image>
				<div class="assess-userinfo">
					<text style="color: #888888;font-size: 25upx;">{{assess.nickename}}</text>
					<text>{{assess.businessCommentsContent}}</text>
				</div>
				<div class="assess-likeinfo" @click="tapassessgreat(index,assess.businessCommentsId)">
					<image :src="assess.assessgreatimg"></image>
					<text :class="assess.classname" style="width: 30upx;margin-top: 15upx;">{{assess.businessCommentsNumber}}</text>
				</div>
			</div>
		</div>
	</view>
</template>

<script>
	import WXAJAX from "../../utils/request";
	
	export default {
		data() {
			return {
				assess:[]
			}
		},
		methods: {
			tapassessgreat(index,id) {
				if (this.assess[index].isCardCommentsGreat == 0) {
					
					this.assess[index].classname = "assesscount2";
					var i = this.assess[index].businessCommentsNumber;
					i++
					this.assess[index].businessCommentsNumber = i;
					this.assess[index].assessgreatimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
					WXAJAX.POST(
					  {
					    businessCommentsId: id,
					  },
					  "",
					  "/businessCard/isCommentsGreat"
					)
					this.assess[index].isCardCommentsGreat = 1
				} else {
					uni.showToast({
						title: '你已经点过赞了',
						icon :'none'
					});
				}
			},
			getassessMore(){
				WXAJAX.POST({
					},
					"",
					"/businessCard/CommentsMore"
				).then((data)=>{
					this.assess=data
					if(this.assess){
					this.assess.forEach(item => {
						this.$set(item, 'assessgreatimg', "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzan_d.png");
						this.$set(item, 'classname', "assesscount");
						if (item.isCardCommentsGreat == 1) {
							item.classname = "assesscount2";
							item.assessgreatimg = "http://yueang2.oss-cn-qingdao.aliyuncs.com/wm-img/dianzn.png";
						}
					})
					}
				})
				
			}
		},
		mounted() {
			this.getassessMore();
		},
		onLoad() {
			
		}
	}
</script>
<style scoped>
	@import url("../../common/index/index.css");
</style>
<style>
	page{
		background-color: white;
	}
	.self_introduce {
		min-height: 214upx;
		transition: 0.1s;
		overflow: hidden;
		width: 90%;
		margin-left: 5%;
		background-color: white;
	}
	
	.self_introduce.higher {
		height: 100%;
	}
	
.assessinfo {
		display: flex;
		flex-direction: row;
		margin-bottom: 10upx;
	}

	.assess-userinfo {
		display: flex;
		flex-direction: column;
		width: 80%;
	}

	.assessinfo image {
		height: 70upx;
		width: 70upx;
		margin-top: 20upx;
		margin-right: 20upx;
	}

	.assess-likeinfo {
		display: flex;
		flex-direction: row;
		float: right;

	}

	.assess-likeinfo image {
		width: 30upx;
		height: 30upx;
		margin-right: 10upx;
	}
</style>
